package com.deyuanyun.pic.settings.domain;

import org.springframework.beans.factory.annotation.Autowire;
import org.springframework.beans.factory.annotation.Configurable;

import java.io.Serializable;
import java.util.Date;

/**
 * User: hlw
 * Date: 15-7-29
 * Time: 下午3:30
 */
@Configurable(autowire = Autowire.BY_TYPE)
public abstract class Domain implements Serializable {

    private String id;

    private int version;

    private Date createDate = new Date();

    private String createUser;

    private String createRemark;

    private Date updateDate;

    private String updateUser;

    private String updateRemark;

    private short deleted;


    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public int getVersion() {
        return version;
    }

    public void setVersion(int version) {
        this.version = version;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public String getCreateUser() {
        return createUser;
    }

    public void setCreateUser(String createUser) {
        this.createUser = createUser;
    }

    public String getCreateRemark() {
        return createRemark;
    }

    public void setCreateRemark(String createRemark) {
        this.createRemark = createRemark;
    }

    public Date getUpdateDate() {
        return updateDate;
    }

    public void setUpdateDate(Date updateDate) {
        this.updateDate = updateDate;
    }

    public String getUpdateUser() {
        return updateUser;
    }

    public void setUpdateUser(String updateUser) {
        this.updateUser = updateUser;
    }

    public String getUpdateRemark() {
        return updateRemark;
    }

    public void setUpdateRemark(String updateRemark) {
        this.updateRemark = updateRemark;
    }

    public boolean isDeleted() {
        return deleted == 0 ? false : true;
    }

    public short getDeleted() {
        return deleted;
    }

    public void setDeleted(short deleted) {
        this.deleted = deleted;
    }

    public void resetLastUpdated() {
        this.updateDate = new Date();
    }
}
